<?php

namespace projetPHP\idkdoBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * projetPHP\idkdoBundle\Entity\Cadeau
 *
 * @ORM\Table()
 * @ORM\Entity(repositoryClass="projetPHP\idkdoBundle\Entity\CadeauRepository")
 */
class Cadeau
{

    /**
     * @ORM\ManyToOne(targetEntity="projetPHP\idkdoBundle\Entity\Compte")
     */
    private $compte; 

    /**
     * @ORM\ManyToMany(targetEntity="projetPHP\idkdoBundle\Entity\Genre")
     */
    private $genres;

    /**
     * @ORM\ManyToOne(targetEntity="projetPHP\idkdoBundle\Entity\Occasion")
     */
    private $occasion;

    /**
     * @ORM\ManyToOne(targetEntity="projetPHP\idkdoBundle\Entity\Personne")
     */
    private $personneRecevant;

    /**
     * @ORM\ManyToOne(targetEntity="projetPHP\idkdoBundle\Entity\Personne")
     */
    private $personneOffrant;

    /**
     * @var datetime $date
     *
     * @ORM\Column(name="date", type="datetime")
     */
    private $date;


    public function __construct(){
        $this->genres = new \Doctrine\Common\Collections\ArrayCollection;
    }

    /**
     * Get date
     *
     * @return datetime 
     */
    public function getDate()
    {
        return $this->date;
    }

    /**
     * Set date
     *
     * @param datetime $date
     */
    public function setDate($date)
    {
        $this->date = $date;
    }

    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $titre
     *
     * @ORM\Column(name="titre", type="string", length=255)
     */
    private $titre;

    /**
     * @var text $description
     *
     * @ORM\Column(name="description", type="text")
     */
    private $description;

    /**
     * @var string $lienPhoto
     *
     * @ORM\Column(name="lienPhoto", type="string", length=255)
     */
    private $lienPhoto;

    /**
     * @var boolean $estOffert
     *
     * @ORM\Column(name="estOffert", type="boolean")
     */
    private $estOffert;

    /**
     * Get id
     *
     * @return integer 
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set titre
     *
     * @param string $titre
     */
    public function setTitre($titre)
    {
        $this->titre = $titre;
    }

    /**
     * Get titre
     *
     * @return string 
     */
    public function getTitre()
    {
        return $this->titre;
    }

    /**
     * Set description
     *
     * @param text $description
     */
    public function setDescription($description)
    {
        $this->description = $description;
    }

    /**
     * Get description
     *
     * @return text 
     */
    public function getDescription()
    {
        return $this->description;
    }

    /**
     * Set lienPhoto
     *
     * @param string $lienPhoto
     */
    public function setLienPhoto($lienPhoto)
    {
        $this->lienPhoto = $lienPhoto;
    }

    /**
     * Get lienPhoto
     *
     * @return string 
     */
    public function getLienPhoto()
    {
        return $this->lienPhoto;
    }

    /**
     * Set estOffert
     *
     * @param boolean $estOffert
     */
    public function setEstOffert($estOffert)
    {
        $this->estOffert = $estOffert;
    }

    /**
     * Get estOffert
     *
     * @return boolean 
     */
    public function getEstOffert()
    {
        return $this->estOffert;
    }


    public function getGenres()
    {
        return $this->genres;
    }

    public function addGenre($genre)
    {
        // On traite vraiment notre ArrayCollection comme un tableau.
        $this->genres[] = $genre;
    }

    public function getOccasion(){
        return $this->occasion;
    }

    public function setOccasion($occasion){
        $this->occasion = $occasion;
    }

    public function getCompte(){
        return $this->compte;
    }

    public function setCompte($compte){
        $this->compte = $compte;
    }

    public function getPersonneOffrant(){
        return $this->personneOffrant;
    }

    public function setPersonneOffrant($personneOffrant){
        $this->personneOffrant = $personneOffrant;
    }

    public function getPersonneRecevant(){
        return $this->personneRecevant;
    }

     public function setPersonneRecevant($personneRecevant){
        $this->personneRecevant = $personneRecevant;
    }
}